﻿#region
/*******************************************************************************
** File Name:		    IDCreaterRepository.cs
** Creator:		        chao.jiang 
** EMail:               chao.jiang 
** Create date:	        
** Latest Modifier:
** Latest Modify date:
** Description:		    
** Modify History:
**
** Code Review:
**
** Version number:       1.0.0
*********************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using Phoenix.Entity;
using Phoenix.Respository;
using IBatisNet.DataMapper;
using Phoenix.Data.IBatis;

namespace Phoenix.IBatisRepository
{
    public class IDCreaterRepository : BaseIBatisDao,IIDCreater
    {
    
        public IDCreaterRepository()
            : base("/Config/IBatis/86TCMap.Config")
        {

        }


        // 生成一个ID
        public int GetNewID(string IDName, string Description, int Seed)
        {
            EIDCreater entity = new EIDCreater()
            {
                CreateTime = DateTime.Now,
                CurrentCount = Seed,
                Description = Description,
                IDName = IDName
            };

            return (int)base.SqlMapper.Insert("IDCreaterMap.GetNewID", entity);

        } 

    }
}

